<?php
class ShopHelpers{
	public static function getImageProduct($image, $size='full')
	{
		return Yii::app()->params['shop_url'].'/'.$size.'/'.$image;
	}
	public static function priceFormat ($price) {
		$price = sprintf('%.0f', $price);
		//if(Yii::app()->language == 'de')
		$price = str_replace('.', ',', $price);
		while (true) {
			$replaced = preg_replace('/(-?\d+)(\d\d\d)/', '$1,$2', $price);
			if ($replaced != $price) {
				$price = $replaced;
			} else {
				break;
			}
		}
		$price = str_replace(',', '.', $price);
		$price .= ' '.Yii::app()->params['currencySymbol'];
	
		return $price;
	}
}